package com.team5101.utils;

public class R {
    private Integer code;
    private String message;
    private boolean success;
    private Object data;

    public static R ok(){
        R r = new R();
        r.setCode(10000);
        r.setSuccess(true);
        return r;
    }

    public static R ok(Object obj){
        R r = new R();
        r.setCode(10000);
        r.setSuccess(true);
        r.setData(obj);
        return r;
    }

    public static R error(){
        R r = new R();
        r.setCode(10001);
        r.setSuccess(false);
        return r;
    }


    public static R error(int code ,String message){
        R r = new R();
        r.setCode(code);
        r.setMessage(message);
        r.setSuccess(false);
        return r;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}